
var type = GetQueryString('type');
if(parseInt(type) !=3){
    checkLogin();
}

if (type == undefined) {
    malert('', '非法操作', '返回', function () {
        locationReplace('index.html')
    });
}
if (parseInt(type) == 2) {
    $(".buy-success-h4").html('下单失败');
    $("#btn").html('返 回');
}

if(parseInt(type) == 3){
    $(".buy-success-h4").html('购买失败');
    $("#btn").html('返 回');
}
$(".buy-water").click(function(){
    if (parseInt(type) == 1) {
        redirect('order.html');
    } else if(parseInt(type) == 2){
        redirect('index.html');
    }else if(parseInt(type) == 3){
        var sid = getCache(login_key).sid || '';
        var wx_openid = getCache(login_key).wx_openid ||'';
        var buyer_openid = getCache(login_key).buyer_openid  || '';
        redirect('water-index.html?wx_openid='+wx_openid+'&sid='+sid + '&buyer_openid='+buyer_openid);

    }
});